from django.db import models

# Create your models here.


class PayCallBackLog(models.Model):
	id = models.AutoField(primary_key=True)
	remote_addr = models.CharField(max_length=32, verbose_name='请求来源')
	server_port = models.CharField(max_length=8,verbose_name='服务器端口')
	request_method = models.CharField(max_length=8,verbose_name='请求方式')
	path_info = models.CharField(max_length=32,verbose_name='请求路径')
	url_scheme = models.CharField(max_length=32,verbose_name='请求协议')  #wsgi.url_scheme
	query_string = models.CharField(max_length=32,verbose_name='请求参数')
	request_body = models.CharField(max_length=1000,verbose_name='请求内容',null=True)
	http_user_agent = models.CharField(max_length=128, verbose_name='请求浏览器')
	post_time = models.DateTimeField(verbose_name='请求时间',auto_now_add=True)

	def __str__(self):
		return self.remote_addr
	class Meta:
		db_table = 'OPS_log_paycallbacklog'
		verbose_name_plural = '支付回调日志'
